<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCommentsTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('comments', function(Blueprint $table)
		{
            $table->increments('id',11);
//            $table->primary('comment_id');
            $table->unsignedInteger('page_id',false);
            $table->foreign('page_id')->references('id')->on('pages')->onDelete('cascade');
            $table->string('author',60)->nullable();
            $table->string('email',60)->nullable();
            $table->text('comment')->nullable();
            $table->dateTime('comment_date')->nullable();
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('comments');
	}

}
